<?php
/**
 * --------------------------------------------------------------
 * 单页控制器
 * --------------------------------------------------------------
 * Light Year Doc
 * @author yinq<3331653644@qq.com>
 * --------------------------------------------------------------
 */
namespace app\index\controller;

use app\common\controller\HomeBase;
use app\admin\model\Page as PageModel;

class Page extends HomeBase
{
    /**
     * 阅读
     */
    public function read()
    {
		$route_name = input('route_name/s');
    	if (empty($route_name)) $this->error('参数错误');

        $info = PageModel::where(['route_name' => $route_name])->find();

        PageModel::where('id', $info['id'])->setInc('clicks');
        
        $this->assign([
            'title'   => $info['title'] . ' - ' . config('app.site_setting.web_site_title'),
            'info'    => $info
        ]);
        return $this->fetch();
    }
}